<?php

namespace App\SendRequest;

use GuzzleHttp\Client;

abstract class BaseRequest
{
    protected $clientConfig = [];
    protected $method;
    protected $uri;

    protected function getClientConfig($option = null)
    {
        return $option === null ? $this->clientConfig : ($this->clientConfig[$option] ?? null);
    }

    protected function send()
    {
        $client = new Client($this->clientConfig);

        $response = $client->request($this->method, $this->uri);

        return $response->getBody();
    }
}
